/**
 * *****************************************************************************
 * @file Tool.c
 *
 * @brief Tool source file for the project
 * *****************************************************************************
 */

/* include -------------------------------------------------------------------- */
#include "../Inc/Tool.h"
#include <Windows.h>
#include <time.h>
#include <stdlib.h>


/* Function prototype -------------------------------------------------------- */
/**
 * @brief Display the simulate progress bar.
 */
void ProgressBar(void) {
	srand(time(NULL));

	for (size_t i = 0; i < 64 - 1; i++) {
		printf("System loading [");
		for (size_t j = 0; j < i; j++)
			printf("#");
		printf(">");
		for (size_t z = 0; z < 64 - 1 - i - 1; z++)
			printf("-");
		printf("] %.2f%%", (fint32_t)(i * 100.0f / 64.0f));
		Sleep(rand() % 200);
		printf("\r");
		fflush(stdout);
	}
	printf("System loading [");
	for (size_t j = 0; j < 64; j++)
		printf("#");
	printf("] 100.00%%\t");
	printf("\nSystem loaded successfully\n");	
}
	